package com.nodejs;

import com.loopj.android.image.SmartImage;
import com.loopj.android.image.SmartImageView;
import com.nodejs.utils.Base64Utils;

import android.app.Activity;
import android.content.Intent;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.widget.ImageView;

public class BrowseActivity extends Activity {
	
	private SmartImageView iv;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.activity_browse);
		
		Intent intent = getIntent();
		String img = intent.getStringExtra("img");
		iv = (SmartImageView) findViewById(R.id.iv);
		iv.setImageBitmap(Base64Utils.browseBitmap(this, img));
	}
	
	@Override
	protected void onDestroy() {
		
		BitmapDrawable bd = (BitmapDrawable) iv.getDrawable();
		bd.getBitmap().recycle();
		iv = null;
		
		super.onDestroy();
	}
}
